<template>
  <el-container>
    <el-header style="height: 100px">
      <div class="logo">兼职管理后台</div>
      <div class="avg">
        <el-dropdown @command="logout">
          <p style="line-height: 0; font-size: 25px; color: white">Admin</p>
          <el-dropdown-menu slot="dropdown">
            <el-dropdown-item command="logout()">退出登陆</el-dropdown-item>
          </el-dropdown-menu>
        </el-dropdown>
      </div>
    </el-header>
    <el-container>
      <el-aside width="250px" style="padding-top: 20px">
        <el-menu class="el-menu-vertical-demo" router>
          <el-menu-item index="0" :index="'/userInfo'">
            <i class="el-icon-s-home"></i>
            <span slot="title">首页</span>
          </el-menu-item>
          <el-menu-item index="1" :index="'/userInfo'">
            <i class="el-icon-user-solid"></i>
            <span slot="title">用户管理</span>
          </el-menu-item>
          <el-menu-item index="4" :index="'/jobInfo'">
            <i class="el-icon-s-order"></i>
            <span slot="title">兼职管理</span>
          </el-menu-item>
          <el-menu-item index="2" :index="'/classifyInfo'">
            <i class="el-icon-s-order"></i>
            <span slot="title">分类管理</span>
          </el-menu-item>
          <el-menu-item index='3' :index="'/messageInfo'">
            <i class="el-icon-message-solid"></i>
            <span slot="title">公告管理</span>
          </el-menu-item>
        </el-menu>
      </el-aside>
      <el-main>
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
export default {
  name: "AdminIndex",
  methods:{
    logout(){
      window.localStorage.removeItem("token");
      this.$router.push("/login")
    }
  }
}
</script>

<style lang="less" scoped>
.el-header, .el-footer {
  background-color: #1890ff;
  color: #333;
  line-height: 100px;
  padding: 0px;
  .logo{
    display: inline-block;
    width: 248px;
    height: 98px;
    line-height: 98px;
    text-align: center;
    font-size: 25px;
    color: white;
  }
  .avg{
    display: inline-block;
    height: 30px;
    width: 30px;
    float: right;
    margin-right: 80px;
  }
}

.el-aside {
  color: #333;
  text-align: center;
  line-height: 200px;
}

.el-main {
  background-color: #E9EEF3;
  color: #333;
}

body > .el-container {
  margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}
</style>
